Skip to content

Conversation

sei-renae
Copy link
Contributor

@sei-renae sei-renae commented Sep 19, 2025

Resolves #974


This pull request refactors the project structure and updates the dependency management workflow to simplify and standardize how dependencies are installed and commands are run. The main change is the removal of the explicit use of the src directory in dependency installation and command execution, both in CI workflows and local development scripts. This makes the setup more straightforward and aligns the configuration across Makefile, Docker, and GitHub Actions. Additionally, the project root and versioning configuration have been updated to match the new structure.

Dependency Management and Project Structure:

  • Removed the use of the --project=src flag from all uv sync, uv run, and related commands in CI workflows (deploy_site.yml, link_checker.yml, python-app.yml), the Makefile, and the Dockerfile, simplifying dependency installation and command execution to operate from the project root. [1] [2] [3] [4] [5] [6]

  • Updated the .github/dependabot.yml configuration to remove the /src directory from the list of directories scanned for dependency updates, reflecting the new project structure.

Configuration and Versioning Updates:

  • Moved pyproject.toml from src/pyproject.toml to the project root and updated references in workflows and versioning configuration accordingly. The [tool.setuptools_scm] section now points to the correct version file and root directory. [1] [2]

Cleanup and Environment:

  • Adjusted the Makefile to remove references to src/.venv and src/uv.lock in the clean target, reflecting the new structure.
  • Added an example Docker environment file (docker/env_example) to help avoid container naming collisions.

@sei-renae sei-renae marked this pull request as ready for review September 19, 2025 16:39
Copy link
Contributor

@sei-vsarvepalli sei-vsarvepalli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure thing.

Copy link
Contributor

@ahouseholder ahouseholder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see any changes to docker/Dockerfile or Makefile. Those will break if left unmodified.

pyproject.toml Outdated
[tool.setuptools.packages.find]
where = ["."] # list of folders that contain the packages (["."] by default)
include = ["ssvc*"] # package names should match these glob patterns (["*"] by default)
include = ["src*"] # package names should match these glob patterns (["*"] by default)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we might want this to be src/ssvc/* ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or maybe it's where = ["./src"] and leave include = ["ssvc*"] ?

Copy link
Contributor Author

@sei-renae sei-renae Sep 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All 3 options successfully run uv sync

@ahouseholder ahouseholder marked this pull request as draft September 19, 2025 18:17
@sei-renae
Copy link
Contributor Author

I don't see any changes to docker/Dockerfile or Makefile. Those will break if left unmodified.
@ahouseholder
Interestingly, without changes to either file, make docs built and ran on localhost without issue.
docker compose up -d does fail- I'll fix that.

@sei-vsarvepalli
Copy link
Contributor

I don't see any changes to docker/Dockerfile or Makefile. Those will break if left unmodified.
@ahouseholder
Interestingly, without changes to either file, make docs built and ran on localhost without issue.
docker compose up -d does fail- I'll fix that.

good catch. Didn't run docker...

@ahouseholder
Copy link
Contributor

Before we're done here, we should also:

  • change dependabot.yml to use uv instead of pip as the package-ecosystem
  • remove requirements.txt since everything going forward should depend on pyproject.toml

@ahouseholder
Copy link
Contributor

Also note that the Makefile uses docker-compose for many of its targets, so it's possible that unless you're removing previously composed images the make tasks might not reflect the current configuration and instead are basically running cached images. I think make clean takes care of this, but if it doesn't we should fix that too.

@ahouseholder
Copy link
Contributor

ahouseholder commented Sep 29, 2025

Before we're done here, we should also:

  • change dependabot.yml to use uv instead of pip as the package-ecosystem
  • remove requirements.txt since everything going forward should depend on pyproject.toml

On this front, #986 makes the cut over to uv but since this is changing the location of pyproject.toml we'll still need to update it for that. (remove - "/src" from directories:)

@sei-renae
Copy link
Contributor Author

On this front, #986 makes the cut over to uv but since this is changing the location of pyproject.toml we'll still need to update it for that. (remove - "/src" from directories:)

How did #986 not break dependabot?

@ahouseholder
Copy link
Contributor

How did #986 not break dependabot?

I think basically this line?
https://github.com/CERTCC/SSVC/pull/986/files#diff-dd4fbda47e51f1e35defb9275a9cd9c212ecde0b870cba89ddaaae65c5f3cd28R9

I added the /src to tell Dependabot where to look for pyproject.toml.

@sei-renae sei-renae marked this pull request as ready for review October 13, 2025 13:59
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR moves the Python project configuration from the src subdirectory to the root level, standardizing the project structure and simplifying build commands.

  • Relocates pyproject.toml from src/ to root directory
  • Updates all build tools and CI workflows to reference the root-level configuration
  • Simplifies Docker and GitHub Actions commands by removing --project=src flags

Reviewed Changes

Copilot reviewed 6 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
pyproject.toml Updates package discovery paths and version file location for root-level structure
docker/Dockerfile Removes project-specific arguments and simplifies uv commands
.github/workflows/python-app.yml Updates CI commands to use root-level pyproject.toml
.github/workflows/link_checker.yml Updates workflow triggers and build commands for new structure
.github/workflows/deploy_site.yml Removes project flag from uv sync command
.github/dependabot.yml Removes /src directory from dependency monitoring

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link
Contributor

@ahouseholder ahouseholder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Regarding my comment on the Dockerfile: I just need to check this on my local setup to confirm before approving. All other changes look good though.

@ahouseholder ahouseholder merged commit 14cb0a4 into CERTCC:main Oct 14, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Move /src/pyproject.toml to /pyproject.toml

3 participants